<template>
  <div :id="chartId" class="chart" :style="{backgroundColor: color}">
    {{ option }}
  </div>
</template>
<script>
export default {
  props: ['option'],
  data: () => ({
    chartId: 'chart_' + (+new Date()),
    color: ''
  }),
  watch: {
    'option.color': function(val) {
      this.color = val
      console.log(val, this.color)
    },
    'option.list': function (val) {
      console.log('list', val)
    }
  },
  created() {

  }
}
</script>
<style lang="scss" scoped>
.chart {
  width: 200px;
  height: 100px;
}
</style>
